﻿
using Order.Domain.Entity;
using System;
using System.Collections.Generic;
using System.Text;

namespace Order.Domain.DomainEvent
{
    public class CreateOrderRootEvent : DomainEvent
    {
        public CreateOrderRootMessage CreateOrderRootMessageInfo { get; set; }
        public CreateOrderRootEvent(CreateOrderRootMessage CreateOrderRootMessage) 
        {
            CreateOrderRootMessageInfo = CreateOrderRootMessageInfo;
        }
    }

    public class CreateOrderRootMessage 
    {
        public CreateOrderRootMessage(Guid id, long version, string orderUniqueCode, decimal orderTotalPrice, OrderStatusEnum orderStatus, string userId, DateTime orderCreateTime, List<OrderItem> orderItemRootList)
        {
            Id = id;
            Version = version;
            OrderUniqueCode = orderUniqueCode;
            OrderTotalPrice = orderTotalPrice;
            OrderStatus = orderStatus;
            UserId = userId;
            OrderCreateTime = orderCreateTime;
            OrderItemRootList = orderItemRootList;
        }

        public Guid Id { get; private set; }
        /// <summary>
        /// 聚合根序列号，版本号
        /// </summary>
        public long Version { get; private set; }
        /// <summary>
        /// 订单唯一编号
        /// </summary>
        public string OrderUniqueCode { get; private set; }
        /// <summary>
        /// 订单总价
        /// </summary>
        public decimal OrderTotalPrice { get; private set; }
        /// <summary>
        /// 订单状态
        /// </summary>
        public OrderStatusEnum OrderStatus { get; private set; }
        /// <summary>
        /// 用户Id
        /// </summary>
        public string UserId { get; private set; }
        /// <summary>
        /// 订单创建时间
        /// </summary>
        public DateTime OrderCreateTime { get; private set; }
        /// <summary>
        /// 订单明细
        /// </summary>
        public List<OrderItem> OrderItemRootList { get; private set; }
    }
}
